<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>hello</h1>
{% set name = "zyd" %}
{{ msg | truncate(6,killwords=True, leeway=0) }}
<h2>字典取值</h2>
{{ dic }}<br>
{{ dic.keys() }}<br>
{{ dic.values() }}<br>
<h2>循环遍历取值</h2>
{% for foo in dic %}
    {{ foo }}
{% endfor %}

{% for key,values in dic.items() %}
    {{ key }} ---- {{ values }}
{% endfor %}


<h2>判断循环的次数: </h2>
{% for key,value in dic.items() %}
    {% if loop.first %}
        这是第一次循环: {{ key }} --- {{ value }}
    {% endif %}
{% endfor %}

<h2>Flask特殊变量</h2>
{{ config.name }}
<br>
传入的参数: {{ request.args.get("name") }}
<br>
session 信息: -- {{ session }}


<h2>Flash信息</h2>
{% for foo in get_flashed_messages() %}
    {{ foo }}
{% endfor %}

</body>
</html>